#ifndef __FUN_H__
#define __FUN_H__

#include "hscuda_rasterdata.h"

template<typename DataType>
void printmat(const hs::raster::RasterView<DataType>& mat)
{
    for (int y = 0; y < mat.sizeY(); ++y) {
        for (int x = 0; x < mat.sizeX(); ++x) {
            printf("%6.0f", mat(x, y));
        }
        std::cout << std::endl;
    }
    std::cout << std::endl;
}

/* 计算栅格数据的前缀和 */
void getPrefixOpenSum(const hs::raster::RasterData<float> & raster, hs::raster::RasterData<float> & prefix_sum);

/* 提取大于thre的元素 */
void extractElements(const hs::raster::RasterData<float> & raster, float thre, hs::raster::RasterData<float> & elems);

#endif
